﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MINERP.BLL.PrintManage;
using MINERP.DAL;
namespace MINERP.Xray
{
    public partial class FrmModfiyPaperFaceType : Form
    {
        public FrmModfiyPaperFaceType()
        {
            InitializeComponent();
        }
        public FrmModfiyPaperFaceType(List<int> inList)
        {
            InitializeComponent();
            CurrList = inList;
        }
        private List<int> CurrList=new List<int>();
        BLLMain _bllPrint = new BLLMain();
        private void buttonOk_Click(object sender, EventArgs e)
        {
            if (DialogResult.OK == MessageBox.Show("确认要修改大板的纸型纸面吗？", "确定", MessageBoxButtons.OKCancel, MessageBoxIcon.Question))
            {
                paperFace face = (paperFace)comboBoxPaperFace.SelectedItem;
                paperType type = (paperType)comboBoxPaperType.SelectedItem;
                
                int intRtn=_bllPrint.ModifyFaceType(CurrList,face,type);
                if (intRtn == 0)
                {
                    MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.Close();
                }
                else
                {
                    MessageBox.Show("修改失败，请稍后重试", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.Close();
                }
            }
            

        }

        private void FrmModfiyPaperFaceType_Load(object sender, EventArgs e)
        {
            comboBoxPaperType.DataSource = _bllPrint.GetPaperTypeList();
            comboBoxPaperType.DisplayMember = "Name";
            comboBoxPaperType.ValueMember = "PaperTypeID";

            comboBoxPaperFace.DataSource = _bllPrint.GetPaperFaceList();
            comboBoxPaperFace.DisplayMember = "Name";
            comboBoxPaperFace.ValueMember = "PaperFaceID";
        }

        private void buttonCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
